import request from '@/utils/request'

// #region
export interface I<%= fetchName.slice(0, 1).toUpperCase() + fetchName.slice(1) %>Result {
  code: number;
	msg: string;
	result: {
		<% items.map((item, index) => { _%>
			<%= item.key || `item${index+1}` %>: string;
		<% }) _%>
	};
}

export interface I<%= fetchName.slice(0, 1).toUpperCase() + fetchName.slice(1) %>Params {
	id: number;
}

export function <%= fetchName %>(
	params: I<%= fetchName.slice(0, 1).toUpperCase() + fetchName.slice(1) %>Params
) {
	return request<I<%= fetchName.slice(0, 1).toUpperCase() + fetchName.slice(1) %>Result["result"]>({
		url: `http://127.0.0.1:3001/<%= fetchName %>`, 
		method: 'GET',
		params,
	});
}
// #endregion
